package com.hctg.forced2sleep.activity;

import android.os.Bundle;
import android.provider.Settings;

import com.hctg.forced2sleep.adapter.TutorialActivityAdapter;
import com.hctg.forced2sleep.bean.MineItem;
import com.hctg.forced2sleep.databinding.ActivityTutorialBinding;

/**
 * description: 首页 -> 视频教程, from VideoList
 * company    :
 * @author    : ldf
 * date       : 2024/6/10 on 11:20
 */
public class TutorialActivity extends BaseActivity<ActivityTutorialBinding> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        viewBinding.ivBack.setOnClickListener(v -> { finish(); });
        viewBinding.swipeRefreshLayout.setOnRefreshListener(() -> {
        viewBinding.swipeRefreshLayout.setRefreshing(false);
            getList(true);
        });

        TutorialActivityAdapter mAdapter = new TutorialActivityAdapter();
        viewBinding.recyclerView.setAdapter(mAdapter);

        getList(true);
        mAdapter.addData(new MineItem(0, 0, "cdkj有哪些功能"));
        mAdapter.addData(new MineItem(1, 0, "隐藏桌面图标防卸载"));
        mAdapter.addData(new MineItem(2, 0, "应用监督"));
        mAdapter.addData(new MineItem(3, 0, "页面监督"));
        mAdapter.addData(new MineItem(4, 0, "习惯打卡"));
        mAdapter.addData(new MineItem(5, 0, "如何使用应用白名单专注学习"));
        mAdapter.addData(new MineItem(6, 0, "权限丢失或无法开启问题"));
        mAdapter.addData(new MineItem(7, 0, "好友监督"));
        mAdapter.addData(new MineItem(8, 0, "让cd更加稳定"));
        mAdapter.addData(new MineItem(9, 0, "防卸载-高级篇"));
        mAdapter.addData(new MineItem(10, 0, "防止权限被关闭失效"));
        mAdapter.addData(new MineItem(11, 0, "壁纸守护使用说明"));
    }

    private void getList(boolean isRefresh) {
//        EasyHttp.get(this)
//                .api(GetIndexPageApi.class)
//                .request(new OnHttpListener<Object>() {
//                    @Override
//                    public void onHttpSuccess(Object result) {
//                    }
//                    @Override
//                    public void onHttpFail(Throwable throwable) {
//                    }
//                });
        //定位设置
        String df = Settings.ACTION_LOCATION_SOURCE_SETTINGS;
    }
}